home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Resources / Card.i < prev    next >
Text File  |  1994-12-04  |  6KB  |  230 lines

  1.    {   card.resource include file }
  2.  
  3. {$I "Include:Exec/Nodes.i"}
  4. {$I "Include:Exec/Interrupts.i"}
  5. {$I "Include:Exec/Resident.i"}
  6.  
  7. const
  8.  CARDRESNAME   =  "card.resource";
  9.  
  10. { Structures used by the card.resource                         }
  11.  
  12. Type
  13.  CardHandle = Record
  14.         cah_CardNode        : Node;
  15.         cah_CardRemoved,
  16.         cah_CardInserted,
  17.         cah_CardStatus      : InterruptPtr;
  18.         cah_CardFlags       : Byte;
  19.  end;
  20.  CardHandlePtr = ^CardHandle;
  21.  
  22.  DeviceTData = Record
  23.         dtd_DTsize,                 { Size in bytes                }
  24.         dtd_DTspeed     : Integer;  { Speed in nanoseconds         }
  25.         dtd_DTtype,                 { Type of card                 }
  26.         dtd_DTflags     : Byte;     { Other flags                  }
  27.  end;
  28.  DeviceTDataPtr = ^DeviceTDataPtr;
  29.  
  30.  CardMemoryMap = Record
  31.         cmm_CommonMemory,
  32.         cmm_AttributeMemory,
  33.         cmm_IOMemory        : Address;
  34.  
  35. { Extended for V39 - These are the size of the memory spaces above }
  36.  
  37.         cmm_CommonMemSize,
  38.         cmm_AttributeMemSize,
  39.         cmm_IOMemSize       : Integer;
  40.  
  41.  end;
  42.  CardMemoryMapPtr = ^CardMemoryMapPtr;
  43.  
  44. const
  45. { CardHandle.cah_CardFlags for OwnCard() function              }
  46.  
  47.  CARDB_RESETREMOVE      = 0;
  48.  CARDF_RESETREMOVE      = 1;
  49.  
  50.  CARDB_IFAVAILABLE      = 1;
  51.  CARDF_IFAVAILABLE      = 2;
  52.  
  53.  CARDB_DELAYOWNERSHIP   = 2;
  54.  CARDF_DELAYOWNERSHIP   = 4;
  55.  
  56.  CARDB_POSTSTATUS       = 3;
  57.  CARDF_POSTSTATUS       = 8;
  58.  
  59. { ReleaseCreditCard() function flags                           }
  60.  
  61.  CARDB_REMOVEHANDLE     = 0;
  62.  CARDF_REMOVEHANDLE     = 1;
  63.  
  64. { ReadStatus() return flags                                    }
  65.  
  66.  CARD_STATUSB_CCDET             = 6;
  67.  CARD_STATUSF_CCDET             = 64;
  68.  
  69.  CARD_STATUSB_BVD1              = 5;
  70.  CARD_STATUSF_BVD1              = 32;
  71.  
  72.  CARD_STATUSB_SC                = 5;
  73.  CARD_STATUSF_SC                = 32;
  74.  
  75.  CARD_STATUSB_BVD2              = 4;
  76.  CARD_STATUSF_BVD2              = 16;
  77.  
  78.  CARD_STATUSB_DA                = 4;
  79.  CARD_STATUSF_DA                = 16;
  80.  
  81.  CARD_STATUSB_WR                = 3;
  82.  CARD_STATUSF_WR                = 8;
  83.  
  84.  CARD_STATUSB_BSY               = 2;
  85.  CARD_STATUSF_BSY               = 4;
  86.  
  87.  CARD_STATUSB_IRQ               = 2;
  88.  CARD_STATUSF_IRQ               = 4;
  89.  
  90. { CardProgramVoltage() defines }
  91.  
  92.  CARD_VOLTAGE_0V        = 0;       { Set to default; may be the same as 5V }
  93.  CARD_VOLTAGE_5V        = 1;
  94.  CARD_VOLTAGE_12V       = 2;
  95.  
  96. { CardMiscControl() defines }
  97.  
  98.  CARD_ENABLEB_DIGAUDIO  = 1;
  99.  CARD_ENABLEF_DIGAUDIO  = 2;
  100.  
  101.  CARD_DISABLEB_WP       = 3;
  102.  CARD_DISABLEF_WP       = 8;
  103.  
  104. {
  105.  * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  106.  * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  107.  * Write-enable/protect change interrupts are always enabled.  The defaults
  108.  * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
  109.  *
  110.  * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  111.  * resource base VERSION)
  112.  *
  113.  }
  114.  
  115.  CARD_INTB_SETCLR       = 7;
  116.  CARD_INTF_SETCLR       = 128;
  117.  
  118.  CARD_INTB_BVD1         = 5;
  119.  CARD_INTF_BVD1         = 32;
  120.  
  121.  CARD_INTB_SC           = 5;
  122.  CARD_INTF_SC           = 32;
  123.  
  124.  CARD_INTB_BVD2         = 4;
  125.  CARD_INTF_BVD2         = 16;
  126.  
  127.  CARD_INTB_DA           = 4;
  128.  CARD_INTF_DA           = 16;
  129.  
  130.  CARD_INTB_BSY          = 2;
  131.  CARD_INTF_BSY          = 4;
  132.  
  133.  CARD_INTB_IRQ          = 2;
  134.  CARD_INTF_IRQ          = 4;
  135.  
  136.  
  137. { CardInterface() defines }
  138.  
  139.  CARD_INTERFACE_AMIGA_0  = 0;
  140.  
  141. {
  142.  * Tuple for Amiga execute-in-place software (e.g., games, or other
  143.  * such software which wants to use execute-in-place software stored
  144.  * on a credit-card, such as a ROM card).
  145.  *
  146.  * See documentatin for IfAmigaXIP().
  147.  }
  148.  
  149.  CISTPL_AMIGAXIP = $91;
  150.  
  151. Type
  152.  TP_AmigaXIP = Record
  153.         TPL_CODE,
  154.         TPL_LINK        : Byte;
  155.         TP_XIPLOC       : Array[0..3] of Byte;
  156.         TP_XIPFLAGS,
  157.         TP_XIPRESRV     : Byte;
  158.  end;
  159. {
  160.  
  161.         ; The XIPFLAGB_AUTORUN bit means that you want the machine
  162.         ; to perform a reset if the execute-in-place card is inserted
  163.         ; after DOS has been started.  The machine will then reset,
  164.         ; and execute your execute-in-place code the next time around.
  165.         ;
  166.         ; NOTE -- this flag may be ignored on some machines, in which
  167.         ; case the user will have to manually reset the machine in the
  168.         ; usual way.
  169.  
  170. }
  171.  
  172. const
  173.  XIPFLAGSB_AUTORUN      = 0;
  174.  XIPFLAGSF_AUTORUN      = 1;
  175.  
  176. FUNCTION OwnCard(h : CardHandlePtr) : CardHandlePtr;
  177.     External;
  178.  
  179. PROCEDURE ReleaseCard(h : CardHandlePtr; Flags : Integer);
  180.     External;
  181.  
  182. FUNCTION GetCardMap : CardMemoryMapPtr;
  183.     External;
  184.  
  185. FUNCTION BeginCardAccess(h : CardHandlePtr) : Boolean;
  186.     External;
  187.  
  188. FUNCTION EndCardAccess(h : CardHandlePtr) : Boolean;
  189.     External;
  190.  
  191. FUNCTION ReadCardStatus : Byte;
  192.     External;
  193.  
  194. FUNCTION CardResetRemove(h : CardHandlePtr; flag : Integer) : Boolean;
  195.     External;
  196.  
  197. FUNCTION CardMiscControl(h : CardHandlePtr; control_bits : Integer) : Byte;
  198.     External;
  199.  
  200. FUNCTION CardAccessSpeed(h : CardHandlePtr; nanoseconds : Integer) : Integer;
  201.     External;
  202.  
  203. FUNCTION CardProgramVoltage(h : CardHandlePtr; voltage : Integer) : Integer;
  204.     External;
  205.  
  206. FUNCTION CardResetCard(h : CardHandlePtr) : Boolean;
  207.     External;
  208.  
  209. FUNCTION CopyTuple(h : CardHandlePtr; Buffer : Address;
  210.                    TupleCode, size : Integer) : Boolean;
  211.     External;
  212.  
  213. FUNCTION DeviceTumple(Tumple_Data : Address; Storage : DeviceTDataPtr) : Integer;
  214.     External;
  215.  
  216. FUNCTION IfAmigaXIP(h : CardHandlePtr) : ResidentPtr;
  217.     External;
  218.  
  219. FUNCTION CardForceChange : Boolean;
  220.     External;
  221.  
  222. FUNCTION CardChangeCount : Integer;
  223.     External;
  224.  
  225. FUNCTION CardInterface : Integer;
  226.     External;
  227.  
  228.  
  229.  
  230.